package com.ly.mpayment.persist.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Entity
@Table(name="manual_order"
)
public class ManualOrder {

    /**
     * ID
     */
    private String manualId;
    /**
     * '订单数量
     */
    private Integer orderNum;
    /**
     * '订单金额'
     */
    private BigDecimal orderMoney;

    /**
     * '创建时间'
     */
    private Date createdTime;

    private User manualUser;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name="manual_id", unique=true, nullable=false, length=40)
    public String getManualId() {
        return manualId;
    }

    public void setManualId(String manualId) {
        this.manualId = manualId;
    }

    @Column(name="order_num")
    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    @Column(name="order_money")
    public BigDecimal getOrderMoney() {
        return orderMoney;
    }

    public void setOrderMoney(BigDecimal orderMoney) {
        this.orderMoney = orderMoney;
    }

    @Column(name="created_time")
    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "useruuid")
    public User getManualUser() {
        return manualUser;
    }

    public void setManualUser(User manualUser) {
        this.manualUser = manualUser;
    }
}
